#!/bin/bash
# filename: disk_check.sh

echo -n "请输入硬盘名称: "
read disk_name

usage=$(df -h | grep "$disk_name" | awk '{print $5}' | cut -d'%' -f1)

if [ -z "$usage" ]; then
    echo "错误: 找不到硬盘 $disk_name"
    exit 1
fi

if [ "$usage" -gt 70 ]; then
    echo "警告: 硬盘 $disk_name 使用率 ${usage}% > 70%"
else
    echo "正常: 硬盘 $disk_name 使用率 ${usage}%"
fi
